﻿using System;
using System.Collections;

namespace QueueLx
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue queue = new Queue();
            queue.Enqueue("小张");
            queue.Enqueue("小李");
            queue.Enqueue("小刘");
            Console.WriteLine("购票开始");
            while (queue.Count!=0)
            {
                Console.WriteLine(queue.Dequeue()+"已购票");
            };
            {
                Console.WriteLine("购票结束");
            }
            Console.WriteLine();

            queue.Enqueue("aaa");
            queue.Enqueue("bbb");
            queue.Enqueue("ccc");
            Object[] obj= queue.ToArray();
            foreach (var i in obj)
            {
                Console.WriteLine(i);
            }

            IEnumerator enumerator = queue.GetEnumerator();
            while (enumerator.MoveNext()) 
            {
                Console.WriteLine(enumerator.Current);
            }
        }
    }
}
